using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace MechaShark
{
    class Projectile
    {
        //-------------Members-------------
        public Model Model;
        public BasePrimitive Primitive;
        public Matrix currentView;
        public Matrix currentProj;

        public float Arc = 90;
        public float Rotation = 90;
        public float Distance = 100;

        public float xpos;
        public float ypos;

        //-------------Methods-------------
        //constructor
        public Projectile(Model model, float x, float y)
        {
            Model = model;
            xpos = x;
            ypos = y;
        }
        public Projectile(BasePrimitive primitive, float x, float y)
        {
            Primitive = primitive;
            xpos = x;
            ypos = y;
        }
        public void moveProjectile(GraphicsDevice Device, GameTime gameTime, int speed)
        {
            float time = (float)gameTime.ElapsedGameTime.TotalMilliseconds;
            xpos += speed * time * 0.10f; //adjust in the future for diagonal shots?

            currentView = Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation)) *
            Matrix.CreateRotationX(MathHelper.ToRadians(Arc)) *
            Matrix.CreateTranslation(xpos, ypos, -Distance);

            currentProj = Matrix.CreatePerspectiveFieldOfView(MathHelper.Pi / 4,
                                                                    Device.Viewport.AspectRatio,
                                                                    1,
                                                                    1000);
        }
    }
}
